﻿//======================================================================
//
//        Copyright : Zhengzhou Strawberry Computer Technology Co.,LTD.
//        All rights reserved
//        
//        Application:NFinal MVC framework
//        Filename :Controller.cs
//        Description :控制器
//
//        created by Lucas at  2015-6-30`
//     
//        WebSite:http://www.nfinal.com
//
//======================================================================
using System;
using System.Collections.Generic;
namespace WebApplication1.DDD
{
    //Controller基类
    public class Controller : NFinal.OwinAction
    {
        public Controller() { }
        public Controller(string fileName, NFinal.Owin.Request request, NFinal.CompressMode compressMode) : base(fileName, request, compressMode)
        {
            Cookie = new Code.Data.CookieManager(this);
            Session = new Code.Data.SessionManager(Cookie.SessionId, new NFinal.Cache.RedisCache("localhost", 20));
        }
        public Controller(System.IO.Stream stream, NFinal.Owin.Request request, NFinal.CompressMode compressMode) : base(stream, request, compressMode)
        {
            Cookie = new Code.Data.CookieManager(this);
            Session = new Code.Data.SessionManager(Cookie.SessionId, new NFinal.Cache.RedisCache("localhost", 20));
        }
        public Controller(IDictionary<string, object> enviroment, NFinal.Owin.Request request, NFinal.CompressMode compressMode) : base(enviroment, request, compressMode)
        {
            Cookie = new Code.Data.CookieManager(this);
            Session = new Code.Data.SessionManager(Cookie.SessionId, new NFinal.Cache.RedisCache("localhost", 20));
        }
        public void Error(string msg, string url, int second)
        {
            //Web.Default.Common.Public.ErrorAction errorAction = new Web.Default.Common.Public.ErrorAction(this);
            //errorAction.Error(msg, url, second);
        }
        public void Success(string msg, string url, int second)
        {
            //Web.Default.Common.Public.SuccessAction successAction = new Web.Default.Common.Public.SuccessAction(this);
            //successAction.Success(msg, url, second);
        }
    }
}